<%-- 
Views an given article
--%>

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<t:template>
	<c:if test="${created}">
		<p class="highlight">Article successfully created</p>
	</c:if>
	<article>
		<%-- article title should never be empty --%>
		<h1>${article.title}</h1>
		
		<%-- checks if we have an image to show --%>
		<c:if test="${!empty article.imageLocation}">
			<canvas id="watermark"></canvas>
			
			<%-- run watermark script --%>
			<script type="text/javascript">
				watermark("${article.imageLocation}");
			</script>
		</c:if>
		
		<%-- checks if we have a subtitle to show --%>
		<c:if test="${!(empty article.subtitle)}">
			<h4>${article.subtitle}</h4>
		</c:if>
		<%-- checks if we have author's name to show --%>
		<c:if test="${!(empty article.author)}">
			<p>By: ${article.author}</p>
		</c:if>
		<%-- Date and article content should always be there --%>
		<p>${article.dateString}</p>	
		<p>${article.content}</p>
		<br class="clear" />
	</article>
	
	<%-- watermark script --%>
	
</t:template>